#!/bin/bash

# 构建MCP服务器
echo "Building MCP Server..."
go build -o drcom-mcp-server main_mcp_server.go

if [ $? -eq 0 ]; then
    echo "✅ Build successful! Executable: drcom-mcp-server"
    
    # 创建简化的mcp.json for executable
    cat > mcp_executable.json << EOF
{
  "mcpVersion": "2024-11-05",
  "name": "drcom-server",
  "version": "1.0.0",
  "description": "Drcom业务系统查询工具，支持用户使用量和联系信息查询",
  "server": {
    "command": "./drcom-mcp-server"
  }
}
EOF
    echo "✅ Created mcp_executable.json for binary execution"
else
    echo "❌ Build failed"
    exit 1
fi 